import 'babel-polyfill'
import 'classlist-polyfill'
import './styles/common.scss'
import './styles/report.scss'
import Vue from 'vue'
import axios from './router/axios'
import VueAxios from 'vue-axios'
import App from './App'
import router from './router/router'
import 'avue-plugin-ueditor/packages'
import './permission' // 权限
import './error' // 日志
// import 'avue-plugin-transfer/packages' //引入avue-plugin-transfer插件
// import 'avue-plugin-ueditor/packages' //引入avue-plugin-ueditor插件(如果要兼容ie自行换掉富文本编辑器，此款插件不兼容ie)
import store from './store'
import { loadStyle } from './util/util'
import Print from './util/print'
Vue.use(Print) // 注册
import * as urls from '@/config/env'
import { iconfontUrl, iconfontVersion } from '@/config/env'
import * as filters from './filters' // 全局filter
import VueJsonp from 'vue-jsonp'
Vue.use(VueJsonp)
Vue.use(window.AVUE)

// //源文件包
// import './packages/index.js';
// import './packages/theme-chalk/src/index.scss';

import basicContainer from './components/basic-container/main'
import selectItem from './components/select-item/main'

Vue.use(router)

Vue.use(VueAxios, axios)

//注册全局容器
Vue.component('basicContainer', basicContainer)
Vue.component('selectItem', selectItem)
// 加载相关url地址
Object.keys(urls).forEach(key => {
  Vue.prototype[key] = urls[key]
})

// 加载过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
  loadStyle(iconfontUrl.replace('$key', ele))
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
